<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<!--在这里写你的css-->
<div th:fragment="stylesheet">

</div>
<!--在这里写你的内容-->

<body id="test" th:fragment="content">

<div class="panel" style="padding: 10px">
    <div class="panel-heading">
        <h3 class="panel-title">添加医院信息</h3>
    </div>
    <form name="add_health_info">
        <div>
            <div class="box-body col-md-6">
                <label for="id">医院编号</label>
                <input id="id" type="text" class="form-control" placeholder="输入医院编号">
                <br>
                <label for="name">医院名称</label>
                <input id="name" type="text" class="form-control" placeholder="输入医院名称">
                <br>
                <label for="nature">nature</label>
                <input id="nature" type="text" class="form-control" placeholder="输入nature">
                <br>
                <label for="hospitalType">医院类型</label>
                <input id="hospitalType" type="text" class="form-control" placeholder="输入医院类型">
                <br>
                <label for="grade">医院级别</label>
                <input id="grade" type="text" class="form-control" placeholder="输入医院等级">
                <br>
                <label for="phoneNumber">联系电话</label>
                <input id="phoneNumber" type="text" class="form-control" placeholder="输入联系电话">
                <br>
            </div>
            <div class="box-body col-md-6">
                <label for="address">地址</label>
                <input id="address" type="text" class="form-control" placeholder="输入地址">
                <br>
                <label for="addressProvince">所在省份</label>
                <input id="addressProvince" type="text" class="form-control" placeholder="输入医院所在省份">
                <br>
                <label for="addressCity">所在城市</label>
                <input id="addressCity" type="text" class="form-control" placeholder="输入医院所在城市">
                <br>
                <label for="addressCounty">所在国家</label>
                <input id="addressCounty" type="text" class="form-control" placeholder="输入医院所在国家">
                <br>
                <label for="addressTown">所在城镇</label>
                <input id="addressTown" type="text" class="form-control" placeholder="输入医院所在城镇">
                <br>
                <label for="addressDetail">具体地址</label>
                <input id="addressDetail" type="text" class="form-control" placeholder="输入医院具体地址">
                <br>
            </div>
            <div class="box-body" style="padding: 10px">
                <label for="introduce">相关介绍</label>
                <textarea id="introduce" rows="5" class="form-control" style="resize: none; width: 100%" placeholder="输入医院相关介绍"></textarea>
                <br>
            </div>

        </div>

        <div  class="box-body ">
            <button id="submit" type="button" class="btn btn-primary btn-block">确定</button>
        </div>

    </form>
</div>
</body>
<!--在这里定义或者引用你的script-->
<div th:fragment="script">
    <script>;
    $('#submit').click(function(){
        $.ajax({
            type: "post",
            url: "/contents/hospital/add",
            data:
            {
                id:$("#id").val(),
                name:$("#name").val(),
                phoneNumber:$("#phoneNumber").val(),
                nature:$("#ature").val(),
                hospitalType:$("#hospitalType").val(),
                grade:$("#grade").val(),
                address:$("#address").val(),
                addressProvince:$("#addressProvince").val(),
                addressCity:$("#addressCity").val(),
                addressCounty:$("#addressCounty").val(),
                addressTown:$("#addressTown").val(),
                addressDetail:$("#addressDetail").val(),
                introduce:$("#introduce").val(),
            },
            success: function (data,status) {
                alert("successful");
                $("#test").load(location.href + "#test");//重新加载整个<body>
            },
            error:function (data) {
                alert("error");
            }
        });
    })
    </script>
</div>

</html>